<template>
    <div class="home" >
        <el-container>
            <el-header><top></top></el-header>
            <el-container>
                <el-aside style="width: auto;"><menu1></menu1></el-aside>
                <el-main class="main">
                    <router-view/>
                </el-main>
            </el-container>
        </el-container>
    </div>

</template>

<script>
import {queryById,userPage,addUser} from '@/api/user'
import empty from '@/components/Empty/index.vue'
import menu1 from '@/components/menu/index.vue'
import top from '@/components/top/index.vue' 
export default {
    components:{
      empty,
      top,
      menu1
    },
    methods:{
        queryById(){
           const result = queryById(1)
          result.then((res)=>{
            console.log(res.data)
          })
        },
        page(){
          const result = userPage('',1,3)
          result.then((res)=>{
            console.log(res.data)
          })
        },
        addUser(){
          const user = {
            "avatar": "",
            "id": 9,
            "idNumber": 999999,
            "name": "zlz",
            "phone": 1596777,
            "roleId": 3,
            "sex": 0,
            "storeId": 1,
            "username": "zlz"
          }
          const result = addUser(user)
          result.then((res)=>{
            console.log(res.data)
          })
        },
        logout(){
          //移除store数据
          this.$store.commit('user/removeUserInfo')
          this.$router.go(0)
          //移除cookie？
        }

    }
}
</script>

<style scoped>
    .home{

    }

  .main{
    height: 92vh;
  }

  .el-header, .el-footer {
    /* background-color: #B3C0D1; */
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .el-header{
    /* background-color:#FDB70A; */
    /* background-color:#BD8032; */
    /* background-color: #66ccf4; */
    background-color:#93c7ff;
  }
  
  .el-aside {
    background-color: #D3DCE6;


    /* color: #333; */
    color: #ffffff;
    text-align: center;
    line-height: 200px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    /* line-height: 20px; */
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>